Landstalker Translation Tool v0.9b Help File
------------------------------------------------
Coded by Gufino2 on Feb 2007
http://gufospace.altervista.org/LTT
bugsman@libero.it
-----------------------------------------------
Disclaimer:

Copyright for the game are property of their legal owner.
This software doesn't helps illegal duplication of copyrighted material. 
This software comes with NO WARRANTY to the maximum extents, so the author is NOT to be considered responsible for any event or damage or data-loss caused by the use or mis-use of this software.
This software HAS TO BE distributed free of charge and in its original form (a zip archive containing this text file, the software executable file and a folder containing GeneTic v0.2 software). The author is NOT responsible for other people using this software to gain money, or for any other illegal use, or use against the terms of this disclaimer.
------------

Content of this archive:
the software executable file (LTTv09b.exe)
a special rom patch (base_rom.ips)
some special table files (intro.tbl, names.tbl, ending.tbl,text.tbl)
this text file (LTT_help.txt)

a GeneTic_v02 folder, containing GeneTic software, that could be used to apply the patch.
the GeneTic_v02 folder contains the following files:
GenTic v0.2 executable (Genetic_02.exe)
GenTic v0.2 English help file (Genetic02.hlp)
GenTic v0.2 Italian help file (Genetic02_ita.hlp)

Intro:
------
Hi guyz, Gufino2 from Italy here. This document is the help file for my Landstalker Translation Tool, v0.9beta. As you can tell by the name, this software will help you translate Climax' "Landstalker" game into your language. I hacked the rom and translated it into italian, using some tools coded by myself. These tools were command line only (no GUI) and were so obscure that they were usable just by myself. After releasing my translation patch, some nice guys from Brasil ( http://www.brgames.org ) asked me to give'em my tools becouse they wanted to translate Landstalker to Portuguese. At this point I started putting all my tools togheter in a single GUI software, easier to use, resulting in this Landstalker Translation Tool.

What do I need?
-----------------------

I want to tell you that you CAN'T translate the game just with this tool. This tool will help you extract graphics and text from the rom, and recompressing/reinserting modified version, but YOU WILL NEED other tools to modify the extracted graphics and text. 
These are the tools you will need:

Graphic editor: 	Tile Layer Pro v1.1 	-- http://www.zophar.net/utilities/graphutil.html
Table Editor:	TaBuLar v 1.0	-- http://www.zophar.net/utilities/table.html
Hex Editor:	Thingy32		-- http://www.zophar.net/utilities/hexutil.html

This is just a suggested list, but I used this tools and tailored mine on these, expecially for the text section, son don't blame me if other tools don't work with Landstalker Translation Tool, ok?

Oh and of course you will need a Landstalker rom file. You will NEED a particular version of the file to work on. More on this later. Well, not much later....

HOW TO TRANSLATE THE GAME:
--------------------------------------------------
Step 1: the base rom...

First step is to create what I call "the base rom". This rom is just the european Pal English Landstalker rom, in Bin format, and patched in a particular way. Why all this mess? Well, the reason is that the "normal" Landstalker rom has very little space for compressed text blocks extensions, and NO space for font extension. The particular patch applied to create the "base rom" just rearranges things inside the rom and modify parts of the game program to make it possible to extend text blocks and to add five more chars to the standard font. This is a good rom we can start working on :) Ok, enough, let's see how to build the "base rom":
- First of all you will need the English PAL Landstalker rom, you can find it here: 
	http://www.romnation.net/srv/roms/19064/genesis/Landstalker-The-Treasures-of-King-Nole-E-English.html

IMPORTANT NOTE: Of course it is not legal to download the rom file if you don't own the original Landstalker rom. I'm a proud owner of the original MegaDrive game, so I was ok at using the file. I can't be held resposibile for any legal trouble related to rom files. Be warned!

You can download it even from other sites, but CHECK the rom Info, it should read like this:

	Landstalker
	(C)SEGA 1993.JUL
	E

To get the rom info you can use the function of my GeneTic software (included into this zip archive). If rom info is different, DON'T use this rom with Landstalker Translation Tool, it WON'T WORK!
Now we got our rom, let's start Landstalker Translation Tool (LTT from now on), and from the main menu choose Base Rom -> Create Base Rom.
In the following dialog you have to select the original rom file (the one you downloaded from the link above ;) and the name of the resulting "base file". Just click on the Apply!!! button et voil, your "base file" is ready :) You can create a base rom in another way: you can simply apply the base_rom.ips patch file to the original rom file with any IPS-patching software (yeah, even with GeneTic).
Our base file is the patched rom we will use as base rom in every following step (Gfx extraction/modification, Txt extraction/modification) and so on... Take care of your work, and make a backup copy of your base file. It's easy to screw up something, and LTT is still quite buggy, so please BACKUP YOUR WORK OFTEN!

Step 2: graphics, in & out...

Part of the Landstalker graphics is compressed with some sort of RLE algo. LTT can decompress&extract graphics, and compress&insert your modified versions. 
Extraction:
In LTT main menu, choose Graphics->Extract Graphics. You'll see a new dialog, where you have to select the rom file (this should be the base file we created before), the hexadecimal offset into the file where the graphics starts, and the name of the resulting file that will contain uncompressed graphics. NOTE: you have to write the hex offset WITHOUT leading 0x, we're not writing C code here :) You will find a list of graphics offsets at the end of this help file, in the BASE ROM MAP section.
Modification:
You can modify the uncompressed graphics opening the file with Tile Layer Pro and setting it to Genesis (4bpp) mode. You will find details about graphic modes at the end of this help file, in the BASE ROM MAP section.
Inserting:
You can insert back your modified graphics selecting Graphics -> Insert Graphics from LTT main menu. You'll se a dialog and you have to select the rom file (this should be the base file we're working on), the file containing modified graphics, and the offset we should insert at, in hex with no 0x, as before. Now just push the Insert! button and wait for the compression to end. IMPORTANT NOTE: if the compressed modified graphics is bigger than the original one, the reinsertion will corrupt the rom. My compression routine sometimes compress better than Climax original one, but there are cases where heavy gfx modifications (or NO modifications at all) can lead in new graphics block being bigger than the original. No workaround here, if you corrupted a rom this way, just take back your backup one (I already told you, always backup), and lighten your changes. LTT tells you the size of original compressed block when you extract it, and tells you the size of the new compressed block when you insert it, so you can see if corruption will occour.

Step 3: So many words...

Landstalker text can be divided in two groups: compressed and uncompressed. Uncompressed text are: intro text, final credits text, objects/locations/characters names. These text can be modified with Thingy32: open the base file you're working on, using the right Thingy table(included in the LTT archive, intro.tbl for intro text, names.tbl for names and ending.tbl for final credits).
All names are preceded by one byte telling the length of the name, in chars. As for the intro and ending text, I haven't hacked the codes yet, so you can modify the text but not size/position. If you find out something, let me know, of course :)

All the sentences of the game are compressed with a sort of char-by-char based huffman compression. No problem, LTT will do all the gruntwork for you :) That's exactly why I made it ehehehehe.
Extraction:
In LTT main menu choose Text -> Extract text, and in the next dialog you have to choose the rom file (the file from wich to extract text), and the text file (a .txt file with resulting extracted sentences). Note the small checkbox "Original Climax Rom". It is unchecked, and it should remain unchecked if you are extracting from a base rom created with LTT. You should check this box only if you are, for some reason, extracting text from the original unpatched English Pal Landstalker rom. To make things straight this checkbox switch extraction from  85-chars font (checked, original Climax mode), to 90-chars extended font (patched base rom). 
Symbols in text:
Special characters (sentence end, pause etc) are represented with their hex char enclosed within two | , for example |5F|. Here's their meaning:
In 85-chars original Climax mode:
    56=blinking arrow
    57=line feed
    58=Yes/No
    59=Wait
    5A=numeric variable
    5B=name of the character speaking
    5E=sentence end (on to next character's sentence)
    5F=object name
    62=clear panel, another sentence from the same character will follow

In 90-chars patched mode:
    5B=blinking arrow
    5C=line feed
    5D=Yes/No
    5E=Wait
    5F=numeric variable
    60=name of the character speaking
    63=sentence end (on to next character's sentence)
    64=object name
    67=clear panel, another sentence from the same character will follow

Now, you can translate all the sentences in the text file TLL extracted for you. 
IMPORTANT NOTE 1: you have to use the right codes for special characters, and write the hex code with CAPITALS characters (for example, |5E| is correct, |5e| is not). Errors can lead to LTT crash, I haven't had time to program a strong error checking. This is a to-do for next versions.
IMPORTANT NOTE 2: the character ":" is mapped at 0x47. DON'T use the 0x47 character for other things, since in the game engine the 0x47 char triggers the "speaking buzz", that noise you can hear when a character is speaking. This happens automatically in dialogues, becouse the game engine automatically insert a leading "name: " before every character sentence, thus triggering the sound. If you use the 0x47 improperly, you will risk to trigger strange sound in unintended place. My suggestion is to keep the ":" char at 0x47 and not using it in your translation, leaving its automatic use intact. If you need a : in your translation, create a duplicated : char on another char position, different from 0x47. In future I could consider modifing the patch in order to let the translator choose wich character should be the sound trigger. Following is a section on font modification...

Font modification:
Probably not every language is ok with the standard English font from the game. Mine, for example (italian), needs 5 more charaters: ,,,,. Yours could require others. That's why I modified the game program to extend the available font space from 85 to 90 characters. That should be enough for everyone, I think. If you need to modify the font for your language take the following steps:
- Gfx modification: you need to modify the font graphics. This is uncompressed graphics, just open the rom with Tile Layer Pro, go to the font offset and modify the characters. More details can be found at the end of this file, in the BASE ROM MAP section.
- Table creation: this is necessary to recompress/insert modified text. You have to open TaBuLar, and create a new table. Insert into this table the character with the same mapping you used in modifying the font graphics, then save the table in Thingy table format. Keep this table, we'll need it soon :) Ah, just one thing, about the object menu's font: I haven't found were this font is in the rom, so right now I can't give you any hint about modifying this one, sorry :(

Text Insertion:
From the LTT main menu choose Text -> Insert Text. The dialog will ask us for the name of the table file, text file and rom file. Table file is the .tbl in Thingy Table format we created with TaBuLar. If we didn't modify the game font, we can use the standard text.tbl file, present in the LTT archive. Otherwise we should select the table file we created. Text file is the file containing our translated text, and rom file is the base rom file we're working on. Now click the Insert!!! button and wait for compression/insertion to end. IMPORTANT NOTE: my patch gives a reasonable amount of space for compressed text block. Anyway, in very rare cases (very long translation) this space can be not enough. This would lead to rom corruption. This kind of corruption is still undetected by LTT, and you will notice it only when you see the translated game crashing/misworking. I'll try to fix this in future releases.

Final step:
Don't forget to correct the checksum of your modified rom, when you end your work. Use Base rom -> Fix Rom Checksum.
Well, this is almost everything you should know in order to translate Landstalker. Now following, the section you were all waiting for: base rom map :)

BASE ROM MAP

This section gives you details about the offset into the base rom for graphics, text, and so on. Here it is...

Graphics:
0x9A4EA = intro font, uncompressed graphics, use Tile Layer Pro Genesis (4bpp) mode.
0x2A884 = main font, uncompressed graphics, use Tile Layer Pro GameBoy (2bpp) mode.
 - Note: every character is 8x15 pixels, aka 120 pixels, aka 30 bytes (120*2/8)
 - Note: the patched base rom is in 90-chars mode, so the complete font is 90 chars wide, aka 2700 bytes
0x1FFBD8 -> SEGA logo, compressed gfx block
0x39ED8 -> start screen first tileset, compressed gfx block
0x3A564 -> start screen second tileset, compressed gfx block
0x3BCAE -> start screen third tileset, compressed gfx block
0x3DF8A  -> CLIMAX logo, compressed gfx block
0xFD5C  -> Loading screen compressed gfx block
0x9242 -> In-game upper status bar compressed gfx block
0x11EBB4 -> some other font, uncompressed, use Tile Layer Pro Genesis (4bpp) mode.
Uncompressed Text:

objects names = from 0x29554 to 0x298E5, use names.tbl
names    = from 0x2b310 to 0x2b4de, use names.tbl
playing characters  = from 2b4e0 to 2b531, use names.tbl
locations  = from 298e8 to 299be, use names.tbl

Intro text: 
from 0xc5a0 to 0xc5cd = pointers to intro text blocks, use intro.tbl
from 0xc5ce to 0xc74d = intro text blocks, use intro.tbl

ending text:
from 0x9ED1A to 0x9F49B = ending text, use ending.tbl

And just for your pleasure, here's some more locations for other funny stuff ;)

from 0x1E0000 to 0x1EFFEA = digital SFX
from 0x121BD0 to 0x158870 = uncompressed tiles gfx, use Tile Layer Pro Genesis (4bpp) mode.
from 0x15CF90 to 0x1A42D0= some more uncompressed tiles gfx, use Tile Layer Pro Genesis (4bpp) mode. 
